﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 单元测试_使用Mock
{
    internal class MockSystemEnvironment : IEnvironment
    {
        private bool _soundWasPlayed;

        public MockSystemEnvironment()
        {
        }


        public DateTime Now { get; set; }

        public void PlaySound()
        {
            _soundWasPlayed = true;
        }

        public bool CheckAndResetSound()
        {
            bool result = _soundWasPlayed;
            _soundWasPlayed = false;
            return result;
        }
    }
}